﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using T_BPI.Classes.Base;

namespace T_BPI.Classes.Model
{
    public class Model
    {
        public int id;
        public int input1;
        public int input2;
        public double[] weights;
        public double CR;

        Model() { }

        public Model(int id, int input1, int input2)
        {
            this.id = id;
            this.input1 = input1;
            this.input2 = input2;
            weights = new double[Constants.WEIGHTS_CONST];
            this.CR = 0.0;
        }

        public void setWeights(double[] w)
        {
            for (int i = 0; i < Constants.WEIGHTS_CONST; i++)
                weights[i] = w[i];
        }

        void printWeights()
        {
        //std::cout<<"weights = "<<weights[0]<<"; "<<weights[1]<<"; "<<weights[2]<<"; "<<weights[3]<<std::endl;
        }

        public double f(double xi, double xj)
        {
            return weights[0] + weights[1] * xi + weights[2] * xj + weights[3] * xi * xj;
        }
    }
}
